<template>
  <router-view></router-view>

  <van-tabbar v-model="active" route active-color="#000" v-show="$route.meta.showTabbar == true" placeholder>
    <van-tabbar-item icon="home-o" to="/" style="color: #333;">首页</van-tabbar-item>
    <van-tabbar-item icon="bag-o" to="/Cate" style="color: #333;">分类</van-tabbar-item>
    <van-tabbar-item icon="shopping-cart-o" to="/Cart" :badge="cartArr.length"
      style="color: #333;">购物车</van-tabbar-item>
    <van-tabbar-item icon="contact-o" to="/My" style="color: #333;">我的</van-tabbar-item>
  </van-tabbar>
</template>

<script setup>
import { ref } from "vue";
import { cartArr, loadCartList } from "./store/cart";

let active = ref(0);
console.log();
let token = localStorage.getItem("xx-mall-token");
if (token) {
  loadCartList();
} 
</script>

<style scoped></style>